Skip to content

Rewrite Plex tests#27624

Merged
balloob merged 1 commit into
home-assistant:devfrom
jjlawren:plex_rewrite_tests
Oct 14, 2019
Merged

Rewrite Plex tests#27624
balloob merged 1 commit into
home-assistant:devfrom
jjlawren:plex_rewrite_tests

Conversation

@jjlawren
Copy link
Copy Markdown
Contributor

Description:

Now that I'm starting to understand the testing slightly better, I rewrote the Plex tests to implement several changes:

  • Put mocked constants into a dictionary array
  • Changed mock classes to better reflect actual objects used/returned by plexapi
  • Set up the number of mocked available servers with a parameter
  • Avoid using difficult-to-follow MagicMock and PropertyMock setups
  • Moved flow steps that don't need to be mocked outside of patch context

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@balloob balloob merged commit cf76f22 into home-assistant:dev Oct 14, 2019
@jjlawren jjlawren deleted the plex_rewrite_tests branch October 14, 2019 11:59
@lock lock Bot locked and limited conversation to collaborators Oct 15, 2019
@balloob balloob added this to the 0.100.3 milestone Oct 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants